var num = 71;
var isItPrime = true;

if (num !== 2)
{
    for (var i = 2; i < (Math.sqrt(num) | 0); i++)
    {
        if (num % i === 0)
        {
            isItPrime = false;
            break;
        }
    }
}

if (isItPrime === true)
{
    console.log('The number is prime!');
}
else
{
    console.log('The number is not prime!');
}